package at.fhooe.im440.pandora.events;

import at.fhooe.im440.core.Core;

public class KeyInputEvent extends Event {
	
	static final String TYPE = "KEYEVENT";
	private int keyNumber;
	private String direction;

	public interface Listener extends EventListener{

	}
	
	public KeyInputEvent(int keyNumber) {
		
		this.keyNumber = keyNumber;
		
		switch(keyNumber){
		case 40: //arrow down
			direction = "DOWN";
			break;
		case 38: //arrow up
			direction = "UP";
			break;
		case 39: //arrow right
			direction = "RIGHT";
			break;
		case 37://arrow left
			direction = "LEFT";
			break;
		case 83:
			direction = "ROTATE_LEFT";
			break;
		case 87:
			direction = "ROTATE_RIGHT";
			break;
		}
	}

	
	public int getKey(){
		return keyNumber;
	}
	
	public String getType() {
		return TYPE;
	}


	@Override
	void processEvent(EventListener listener) {
		if(listener instanceof KeyPressedListener ) {
			//((KeyPressedListener) listener).onKeyPressed(this);
		}
	}


	@Override
	public String getData() {
		// TODO Auto-generated method stub
		return null;
	}

}